import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class PeiwanInfo2 extends StatelessWidget {
  String peiwanName;
  int peiwanAge;
  double peiwanHeight;
  double averageScore;
  bool isOnline;
  ImageProvider headpic;

  PeiwanInfo2(this.peiwanName, this.peiwanAge, this.peiwanHeight,
      this.averageScore, this.isOnline, this.headpic);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        children: [
          Container(
              clipBehavior: Clip.hardEdge,
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(10))),
              child: Image(
                width: 40,
                height: 40,
                image: headpic,
                fit: BoxFit.cover,
              )),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Row(
                children: [
                  Text(peiwanName),
                  Text("${peiwanAge}"),
                  Text("${peiwanHeight}"),
                  SizedBox(
                    width: 170,
                  ),
                  CircleAvatar(
                    backgroundColor: Colors.greenAccent,
                    radius: 4,
                  ),
                  Text(isOnline ? "在线" : "离线")
                ],
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  Image.asset(
                    "images/star_selected.png",
                    width: 10,
                    height: 10,
                  ),
                  Text("${averageScore}")
                ],
              )
            ],
          )
        ],
      ),
    );
  }
}
